package com.emmmya.ocs.modules.system.dao;

import com.emmmya.ocs.modules.system.entity.SerialNumber;
import com.emmmya.ocs.common.base.BaseDao;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

public interface SerialNumberDao extends BaseDao<SerialNumber,String> {
    @Modifying
    @Query("update SerialNumber sn set sn.no = 1 where sn.module = :module")
    Integer updateByModule(@Param("module") String module);

    @Modifying
    @Query("update SerialNumber sn set sn.no = 1 where sn.frequency = :frequency")
    Integer updateByFrequency(@Param("frequency") String frequency);
}
